using System;
using System.Runtime.InteropServices;

using Pegasus.Windows.API.Enumerations;

namespace Pegasus.Windows.API.Interfaces
{
	/// <summary>
	/// Exposes methods that manipulate and interact with image lists.
	/// </summary>
	[ComImport]
	[InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
	[Guid( "46EB5926-582E-4017-9FDF-E8998DAA0950" )]
	public interface IImageList
	{
		/// <summary>
		/// Adds an image or images to an image list. 
		/// </summary>
		/// <param name="hImage">A handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.</param>
		/// <param name="hMask">A handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored</param>
		/// <param name="index">The index of the first new image when it returns, if successful, or -1 otherwise</param>
		/// <returns>HRESULT</returns>
        uint Add( IntPtr hImage, IntPtr hMask, ref int index );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="hicon">The hicon.</param>
		/// <param name="pi">The pi.</param>
		/// <returns></returns>
		[PreserveSig]
		uint ReplaceIcon( int i, IntPtr hicon, ref int pi );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="iImage">The i image.</param>
		/// <param name="iOverlay">The i overlay.</param>
		/// <returns></returns>
		[PreserveSig]
		uint SetOverlayImage( int iImage, int iOverlay );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="hbmImage">The HBM image.</param>
		/// <param name="hbmMask">The HBM mask.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Replace( int i, IntPtr hbmImage, IntPtr hbmMask );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="hbmImage">The HBM image.</param>
		/// <param name="crMask">The cr mask.</param>
		/// <param name="pi">The pi.</param>
		/// <returns></returns>
		[PreserveSig]
		uint AddMasked( IntPtr hbmImage, IntPtr crMask, ref int pi );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="imldp">The imldp.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Draw( IntPtr imldp );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Remove( int i );

		/// <summary>
		/// Creates an icon from an image and a mask in an image list.
		/// </summary>
		/// <param name="i">A value of type int that contains the index of the image.</param>
		/// <param name="flags">A combination of flags that specify the drawing style.</param>
		/// <returns>A pointer to the handle of the icon if successful, or IntPtr.Zero if otherwise.</returns>
		IntPtr GetIcon( int i, ILD flags );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="ImageInfo">The image info.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetImageInfo( int i, IntPtr ImageInfo );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="iDst">The i DST.</param>
		/// <param name="unkSrc">The unk SRC.</param>
		/// <param name="iSrc">The i SRC.</param>
		/// <param name="uFlags">The u flags.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Copy( int iDst, IntPtr unkSrc, int iSrc, uint uFlags );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i1">The i1.</param>
		/// <param name="unk2">The unk2.</param>
		/// <param name="i2">The i2.</param>
		/// <param name="dx">The dx.</param>
		/// <param name="dy">The dy.</param>
		/// <param name="riid">The riid.</param>
		/// <param name="pv">The pv.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Merge( int i1, IntPtr unk2, int i2, int dx, int dy, [MarshalAs( UnmanagedType.LPStruct )] Guid riid, ref IntPtr pv );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="riid">The riid.</param>
		/// <param name="pv">The pv.</param>
		/// <returns></returns>
		[PreserveSig]
		uint Clone( [MarshalAs( UnmanagedType.LPStruct )] Guid riid, ref IntPtr pv );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="rc">The rc.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetImageRect( int i, IntPtr rc );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="cx">The cx.</param>
		/// <param name="cy">The cy.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetIconSize( ref int cx, ref int cy );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="cx">The cx.</param>
		/// <param name="cy">The cy.</param>
		/// <returns></returns>
		[PreserveSig]
		uint SetIconSize( int cx, int cy );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="pi">The pi.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetImageCount( ref int pi );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="uNewCount">The u new count.</param>
		/// <returns></returns>
		[PreserveSig]
		uint SetImageCount( int uNewCount );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="clrBk">The CLR bk.</param>
		/// <param name="clr">The CLR.</param>
		/// <returns></returns>
		[PreserveSig]
		uint SetBkColor( IntPtr clrBk, IntPtr clr );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="clr">The CLR.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetBkColor( ref IntPtr clr );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="iTrack">The i track.</param>
		/// <param name="dxHotspot">The dx hotspot.</param>
		/// <param name="dyHotspot">The dy hotspot.</param>
		/// <returns></returns>
		[PreserveSig]
		uint BeginDrag( int iTrack, int dxHotspot, int dyHotspot );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <returns></returns>
		[PreserveSig]
		uint EndDrag();

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="hwndLock">The HWND lock.</param>
		/// <param name="x">The x.</param>
		/// <param name="y">The y.</param>
		/// <returns></returns>
		[PreserveSig]
		uint DragEnter( IntPtr hwndLock, int x, int y );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="hwndLock">The HWND lock.</param>
		/// <returns></returns>
		[PreserveSig]
		uint DragLeave( IntPtr hwndLock );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="x">The x.</param>
		/// <param name="y">The y.</param>
		/// <returns></returns>
		[PreserveSig]
		uint DragMove( int x, int y );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="unk">The unk.</param>
		/// <param name="iDrag">The i drag.</param>
		/// <param name="dxHotspot">The dx hotspot.</param>
		/// <param name="dyHotspot">The dy hotspot.</param>
		/// <returns></returns>
		[PreserveSig]
		uint SetDragCursorImage( IntPtr unk, int iDrag, int dxHotspot, int dyHotspot );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="fShow">The f show.</param>
		/// <returns></returns>
		[PreserveSig]
		uint DragShowNolock( int fShow );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="pt">The pt.</param>
		/// <param name="ptHotspot">The pt hotspot.</param>
		/// <param name="riid">The riid.</param>
		/// <param name="pv">The pv.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetDragImage( IntPtr pt, IntPtr ptHotspot, [MarshalAs( UnmanagedType.LPStruct )] Guid riid, ref IntPtr pv );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="i">The i.</param>
		/// <param name="dwFlags">The dw flags.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetItemFlags( int i, ulong dwFlags );

		/// <summary>
		/// Has not been validated.
		/// </summary>
		/// <param name="iOverlay">The i overlay.</param>
		/// <param name="iIndex">Index of the i.</param>
		/// <returns></returns>
		[PreserveSig]
		uint GetOverlayImage( int iOverlay, ref int iIndex );
	}
}
